# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>

pkgname=runc
pkgdesc="CLI tool for spawning and running containers according to the OCI specification"
url="https://www.opencontainers.org"
_commit=4bccb38cc9cf198d52bebf2b3a90cd14e7af8c06
pkgver=1.1.11
pkgrel=0
arch="all"
license="Apache-2.0"
makedepends="bash go go-md2man libseccomp-dev libtool"
subpackages="$pkgname-doc"
source="https://github.com/opencontainers/runc/archive/v$pkgver/runc-$pkgver.tar.gz
	"
options="!check"

provides="oci-runtime"
provider_priority=90

# secfixes:
#   1.1.4-r0:
#     - CVE-2023-25809
#     - CVE-2023-27561
#     - CVE-2023-28642
#   1.1.4-r7:
#     - CVE-2023-27561
#   1.1.2-r0:
#     - CVE-2022-29162
#   1.0.3-r0:
#     - CVE-2021-43784
#   1.0.0_rc95-r0:
#     - CVE-2021-30465
#   1.0.0_rc10-r0:
#     - CVE-2019-19921
#   1.0.0_rc9-r0:
#     - CVE-2019-16884
#   1.0.0_rc7-r0:
#     - CVE-2019-5736

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make COMMIT="$_commit"
	make man
}

package() {
	install -Dsm755 runc "$pkgdir"/usr/bin/runc
	install -Dm644 "$builddir"/man/man8/* -t "$pkgdir"/usr/share/man/man8/
}

sha512sums="
dbf3d28986f4f6dd1372522113cbe548aa432079704c8b7dc02eb78ece75a75896ae2753ac24be34b2b3aa171bdcc785cc88cfe6bdadbe55c748d41b33ce6f6f  runc-1.1.11.tar.gz
"
